package com.kay.controller;

import com.kay.anno.RPCReference;
import com.kay.api.IUserService;
import com.kay.pojo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: Kay
 * @CreateDate: 2021/8/27$ 21:27$
 * @UpdateUser: Kay
 * @UpdateDate: 2021/8/27$ 21:27$
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @RPCReference
    private IUserService iUserService;

//    public UserController() {
//        this.iUserService = (IUserService) RpcClientProxy.createProxy(IUserService.class);
//    }

    @GetMapping("/findById")
    public User findById(int id){
        return iUserService.findById(id);
    }
}
